/**
 * 动态规划-爬楼梯-力扣70
 */

public class Practice_10 {
    public static void main(String[] args) {
        int n = 44;
        int result = climbStairs(n);
        System.out.println(result);
    }
    public static int climbStairs(int n) {
        if (n <= 3 && n>0) {
            return n;
        }
        if (n <= 0) {
            return -1;
        }
        int[] Dp = new int[n+1];
        Dp[1] = 1;
        Dp[2] = 2;
        for (int i = 3; i <= n; i++) {
            Dp[i] = Dp[i - 1] + Dp[i - 2];
        }
        return Dp[n];
    }
}
